package com.itheima.reggie.mapper;

import com.itheima.reggie.entity.Setmeal;
import com.itheima.reggie.entity.SetmealDish;
import org.apache.ibatis.annotations.*;
import org.springframework.web.bind.annotation.DeleteMapping;

import java.util.List;

@Mapper
public interface SetmealDishMapper {

    void saveBatch(@Param("setmealDishes") List<SetmealDish> setmealDishes);

    void deleteBySetmealIds(@Param("ids") List<Long> ids);


    @Select("select * from setmeal_dish where setmeal_id = #{setmealId}")
    List<SetmealDish> findBySetmealId(Long id);


    @Delete( "DELETE FROM setmeal_dish WHERE setmeal_id =#{setmealId};")
    void deleteBySetmealId(Long seatmealId);

}
